<div class="doc-item" id="doc-891"><h2 class="doc-item-name">gen-interface<span class="namespace">(clojure.core)</span></h2><p class="macro">Macro</p><ul class="var-arglists"><li>(<span class="var-name">gen-interface</span> &amp; options)</li></ul><div class="var-docstring"><p>When compiling, generates compiled bytecode for an interface with
  the given package-qualified :name (which, as all names in these
  parameters, can be a string or symbol), and writes the .class file
  to the *compile-path* directory.  When not compiling, does nothing.
 
  In all subsequent sections taking types, the primitive types can be
  referred to by their Java names (int, float etc), and classes in the
  java.lang package can be used without a package qualifier. All other
  classes must be fully qualified.
 
  Options should be a set of key/value pairs, all except for :name are
  optional:</p><p>:name aname</p><p>The package-qualified name of the class to be generated</p><p>:extends [interface ...]</p><p>One or more interfaces, which will be extended by this interface.</p><p>:methods [ [name [param-types] return-type], ...]</p><p>This parameter is used to specify the signatures of the methods of
  the generated interface.  Do not repeat superinterface signatures
  here.</p></div><div class="var-source"><pre>; clojure/genclass.clj:634
(defmacro gen-interface
  [&amp; options]
  (when *compile-files*
    (let [options-map (apply hash-map options)
          [cname bytecode] (generate-interface options-map)]
      (clojure.lang.Compiler/writeClassFile cname bytecode))))</pre></div><div class="license"><p>Copyright (c) Rich Hickey. All rights reserved.</p><p>The use and distribution terms for this software are covered by the <a href="http://opensource.org/licenses/eclipse-1.0.php">Eclipse Public License 1.0</a>, which can be found in the file
          epl-v10.html at the root of this distribution. By using this software
          in any fashion, you are agreeing to be bound by the terms of this
          license. You must not remove this notice, or any other, from this
          software.</p></div></div>